FROM golang:1.14 AS build

ARG GO111MODULE=on

WORKDIR /go/src/sigs.k8s.io/kustomize/api/internal/crawl
COPY . /go/src/sigs.k8s.io/kustomize//api/internal/crawl

RUN go mod download
RUN CGO_ENABLED=0 go install -v ./cmd/crawler/crawler.go

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /go/bin/crawler /
ENTRYPOINT ["/crawler"]
CMD []
